package datastruct;

public class Index {
	private String 	tableName;
	private String 	name;
	private boolean pk;
	
	public Index()
	{
		super();
		this.name="";
		this.pk=false;
	}
	
	public Index(String name)
	{
		super();
		this.name=name;
		this.pk=false;
	}
	
	public Index(String name, boolean pk)
	{
		super();
		this.name=name;
		this.pk=pk;
	}
	
	public Index(String name, boolean pk, String tableName)
	{
		super();
		this.name=name;
		this.pk=pk;
		this.tableName=tableName;
	}
	
	public String getName()
	{
		return this.name;
	}
	
	public boolean isPrimaryKey()
	{
		return pk;
	}
	
	public String getTableName()
	{
		return this.tableName;
	}
	
	public void setName(String name)
	{
		this.name=name;
	}
	
	public void setPrimaryKey(boolean pk)
	{
		this.pk=pk;
	}
	
	public void setTableName(String tableName)
	{
		this.tableName=tableName;
	}
	
	@Override
	public String toString()
	{
		if(pk)
			return this.name + "*";
		else
			return this.name;
	}
}